home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / quasrsql.zip / SYNTAX.DOC < prev    next >
Text File  |  1992-01-16  |  100KB  |  3,069 lines

  1.  
  2.           Quasar SQL Syntax                                    Page 1 of 52
  3.  
  4.  
  5.                                Quasar SQL For Windows
  6.  
  7.                              Release 2.0 - November 1991
  8.  
  9.  
  10.                                      SQL SYNTAX
  11.  
  12.  
  13.                      Copyright (c) 1991-92 by Stellar Industries
  14.                                  All Rights Reserved
  15.  
  16.  
  17.                                        Summary
  18.  
  19.  
  20.           This document is divided into the following sections:
  21.  
  22.           Overview       This section describes, in general terms, what SQL
  23.                          is and the notation used in this document.
  24.  
  25.           Statements     This section includes a description of the syntax
  26.                          of all SQL Statements supported by Quasar SQL For
  27.                          Windows.
  28.  
  29.           Data Types     This section includes a description of all data
  30.                          types recognized by SQL.
  31.  
  32.           Operators      This section includes a description of all
  33.                          arithmetic operators used with SQL.
  34.  
  35.           Built-in Functions This section includes a description of all
  36.                          built-in functions used with SQL.
  37.  
  38.           Expressions    This section includes a description of the syntax
  39.                          of expressions used with SQL.
  40.  
  41.           Privilege      This section includes a description of the options
  42.                          available in the control of an user's access to
  43.                          data.
  44.  
  45.           Search Condition This section includes a description of the
  46.                          syntax used to select specific data elements.
  47.  
  48.           System Catalog This section includes a description of the tables
  49.                          used by the Quasar Database Administrator to keep
  50.                          track of the database.
  51.  
  52.           Glossary       This section defines specialized terms used in
  53.                          this document.
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.                                                                     Summary
  61.           Quasar SQL Syntax                                    Page 2 of 52
  62.  
  63.  
  64.                                       Overview
  65.  
  66.  
  67.           What is SQL?
  68.  
  69.                     Structured Query Language (SQL - pronounced "sequel")
  70.                     is the lingua franca of the computer database world.
  71.                     It was originally designed by D. D. Chamberlin and
  72.                     others of the IBM Research Laboratory in San Jose,
  73.                     California.  Unlike other languages developed in a
  74.                     rather ad hoc manner, SQL has been designed to
  75.                     manipulate data on a very strict theoretical basis,
  76.                     which makes it stable and predictable.  The fact that
  77.                     SQL has been minimally changed or enhanced in the years
  78.                     it has existed is proof of this fact.  Of course, no
  79.                     one has to know relational algebra, or mathematics for
  80.                     that matter, to use SQL, but it is comforting to know
  81.                     that the language has a solid theoretical basis that
  82.                     will make it lasting and easy to use.
  83.  
  84.                     The power of the language allows software developers to
  85.                     write SQL commands that can replace dozens or even
  86.                     hundreds of lines of code.  This not only greatly
  87.                     reduces development time, but also substantially
  88.                     reduces the expense of maintaining and enhancing
  89.                     systems.  Value-added resellers (VAR) who use SQL can
  90.                     tailor a system to specific customer requirements
  91.                     quickly and at a low cost.
  92.  
  93.           Notational Conventions
  94.  
  95.                     While uppercase is used throughout this document to
  96.                     indicate SQL keywords (COMMIT, SELECT, etc), in
  97.                     actuality the Quasar Database Administrator will accept
  98.                     keywords in either upper or lowercase.  The keyword
  99.                     'COMMIT' may be spelled 'commit', 'Commit', 'COMMIT',
  100.                     etc.
  101.  
  102.                     The names of users, tables, indices and columns, and
  103.                     the content of character fields are, however, case
  104.                     sensitive.  If you used some combination of upper and
  105.                     lower case to create them, you have to use the same
  106.                     combination to access them.  All system names were
  107.                     created using upper case only.
  108.  
  109.                     Optional elements are indicated by enclosing them
  110.                     within square brackets as in [option].  When a choice
  111.                     may be made among a list of possible optional elements,
  112.                     individual selections are separated by vertical bars as
  113.                     in [option1 | option2 | option3].
  114.  
  115.                     When a pattern may be repeated, an ellipsis follows the
  116.                     pattern as in "ColumnName1 [, ColumnName2] ...".  This
  117.  
  118.  
  119.                                                                    Overview
  120.           Quasar SQL Syntax                                    Page 3 of 52
  121.  
  122.  
  123.                     example implies a list of one or more column names
  124.                     separated by commas.
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.                                                                    Overview
  179.           Quasar SQL Syntax                                    Page 4 of 52
  180.  
  181.  
  182.                                      Statements
  183.  
  184.  
  185.           SQL is based on various uses of the following statements:
  186.  
  187.           COMMENT ON COLUMN     Attaches a comment to a record in the
  188.                                 COLUMNS system catalog table.
  189.  
  190.           COMMENT ON TableName  Attaches comments to multiple records in
  191.                                 the COLUMNS system catalog table which are
  192.                                 associated with TableName.
  193.  
  194.           COMMENT ON TABLE      Attaches a comment to a record in the
  195.                                 TABLES system catalog table.
  196.  
  197.           COMMENT ON USER       Attaches a comment to a record in the USERS
  198.                                 system catalog table.
  199.  
  200.           COMMIT                Instructs the Database Administrator to
  201.                                 make all pending changes to the database by
  202.                                 the current transaction permanent.
  203.  
  204.           CREATE INDEX          Creates an index on a database table.
  205.  
  206.           CREATE TABLE          Creates a database table.
  207.  
  208.           DELETE                Deletes records from a database table.
  209.  
  210.           DROP INDEX            Deletes an index from a database table.
  211.  
  212.           DROP TABLE            Deletes a database table.
  213.  
  214.           GRANT CONNECT         Instructs the Database Administrator to
  215.                                 allow an user access to the database.
  216.  
  217.           GRANT Privilege       Instructs the Database Administrator to
  218.                                 allow an user certain access privileges to
  219.                                 a specified table.
  220.  
  221.           INSERT                Creates records in a database table.
  222.  
  223.           REVOKE CONNECT        Instructs the Database Administrator to no
  224.                                 longer allow an user access to the
  225.                                 database.
  226.  
  227.           REVOKE Privilege      Instructs the Database Administrator to
  228.                                 reduce an user's access to a specified
  229.                                 table.
  230.  
  231.           ROLLBACK              Instructs the Database Administrator to
  232.                                 forget all changes made to the database by
  233.                                 the current transaction.
  234.  
  235.           SELECT                Retrieves data from database tables.
  236.  
  237.                                                                  Statements
  238.           Quasar SQL Syntax                                    Page 5 of 52
  239.  
  240.  
  241.           UPDATE                Modifies the content of records within a
  242.                                 database table.
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.                                                                  Statements
  297.           Quasar SQL Syntax                                    Page 6 of 52
  298.  
  299.  
  300.                             Statement: COMMENT ON COLUMN
  301.  
  302.  
  303.           Syntax         COMMENT ON COLUMN
  304.                            [UserName.]TableName.ColumnName
  305.                            IS CharacterString;
  306.  
  307.                          CharacterString is written into the REMARK field
  308.                          of the record associated with ColumnName in the
  309.                          SYSTEM.COLUMNS table.
  310.  
  311.                          Phrase         Description
  312.  
  313.                          [UserName.]TableName.ColumnName
  314.  
  315.                                         Identifies the record in the
  316.                                         SYSTEM.COLUMNS table which is to
  317.                                         receive the comment.  If UserName
  318.                                         is not specified, the current user
  319.                                         is assumed.  Only the system
  320.                                         administrator may specify an
  321.                                         UserName other than his own.
  322.  
  323.                          CharacterString
  324.  
  325.                                         Provides the remark to be used.  A
  326.                                         comment may be removed by
  327.                                         specifying 'NULL'.
  328.  
  329.           Security       The system administrator may apply a comment to
  330.                          any column of any table in the database.  All
  331.                          other users may only apply comments to columns in
  332.                          their own tables.
  333.  
  334.           Concurrency    No locks are acquired.
  335.  
  336.           Comments       A remark in the SYSTEM.COLUMNS table provides a
  337.                          convenient method of documenting the purpose of
  338.                          the column.
  339.  
  340.                          ColumnName, TableName and UserName are limited to
  341.                          32 characters.
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.                                               Statements: COMMENT ON COLUMN
  356.           Quasar SQL Syntax                                    Page 7 of 52
  357.  
  358.  
  359.                            Statement: COMMENT ON TableName
  360.  
  361.  
  362.           Syntax         COMMENT ON [UserName.]TableName (
  363.                            ColumnName1 IS CharacterString1[,
  364.                            ColumnName2 IS CharacterString2] ...
  365.                          );
  366.  
  367.                          Each CharacterString is written into the REMARK
  368.                          field of the record associated with each
  369.                          ColumnName in the SYSTEM.COLUMNS table.
  370.  
  371.                          Phrase         Description
  372.  
  373.                          [UserName.]TableName
  374.  
  375.                                         Identifies the table whose columns
  376.                                         are to receive the comments.  If
  377.                                         UserName is not specified, the
  378.                                         current user is assumed.  Only the
  379.                                         system administrator may specify an
  380.                                         UserName other than his own.
  381.  
  382.                          ColumnName1 IS CharacterString1
  383.  
  384.                                         CharacterString is written into the
  385.                                         REMARK field of the record
  386.                                         associated with ColumnName1 in the
  387.                                         SYSTEM.COLUMNS table.  A comment
  388.                                         may be removed by specifying
  389.                                         'NULL'.
  390.  
  391.                          [, ColumnName2 IS CharacterString2] ...
  392.  
  393.                                         Additional REMARK fields may be
  394.                                         written within SYSTEM.COLUMNS table
  395.                                         by creating a list of definitions
  396.                                         separated by commas.  Comment may
  397.                                         be removed by specifying 'NULL'.
  398.  
  399.           Security       The system administrator may apply a comment to
  400.                          any column of any table in the database.  All
  401.                          other users may only apply comments to columns in
  402.                          their own tables.
  403.  
  404.           Concurrency    No locks are acquired.
  405.  
  406.           Comments       A remark in the SYSTEM.COLUMNS table provides a
  407.                          convenient method of documenting the purpose of
  408.                          the column.
  409.  
  410.                          ColumnName, TableName and UserName are limited to
  411.                          32 characters.
  412.  
  413.  
  414.                                            Statements: COMMENT ON TableName
  415.           Quasar SQL Syntax                                    Page 8 of 52
  416.  
  417.  
  418.                              Statement: COMMENT ON TABLE
  419.  
  420.  
  421.           Syntax         COMMENT ON TABLE [UserName.]TableName
  422.                            IS CharacterString;
  423.  
  424.                          CharacterString is written into the REMARK field
  425.                          of the record associated with TableName in the
  426.                          SYSTEM.TABLES table.
  427.  
  428.                          Phrase         Description
  429.  
  430.                          [UserName.]TableName
  431.  
  432.                                         Identifies the record in the
  433.                                         SYSTEM.TABLES table which is to
  434.                                         receive the comment.  If UserName
  435.                                         is not specified, the current user
  436.                                         is assumed.  Only the system
  437.                                         administrator may specify an
  438.                                         UserName other than his own.
  439.  
  440.                          CharacterString
  441.  
  442.                                         Provides the remark to be used.  A
  443.                                         comment may be removed by
  444.                                         specifying 'NULL'.
  445.  
  446.           Security       The system administrator may apply a comment to
  447.                          any table in the database.  All other users may
  448.                          only apply comments to their own tables.
  449.  
  450.           Concurrency    No locks are acquired.
  451.  
  452.           Comments       A remark in the SYSTEM.TABLES table provides a
  453.                          convenient method of documenting the purpose of
  454.                          the table.
  455.  
  456.                          TableName and UserName are limited to 32
  457.                          characters.
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.                                                Statements: COMMENT ON TABLE
  474.           Quasar SQL Syntax                                    Page 9 of 52
  475.  
  476.  
  477.                              Statement: COMMENT ON USER
  478.  
  479.  
  480.           Syntax         COMMENT ON USER UserName
  481.                            IS CharacterString;
  482.  
  483.                          CharacterString is written into the REMARK field
  484.                          of the record associated with UserName in the
  485.                          SYSTEM.USERS table.
  486.  
  487.                          Phrase         Description
  488.  
  489.                          UserName
  490.  
  491.                                         Identifies the record in the
  492.                                         SYSTEM.USERS table which is to
  493.                                         receive the comment.
  494.  
  495.                          CharacterString
  496.  
  497.                                         Provides the remark to be used.  A
  498.                                         comment may be removed by
  499.                                         specifying 'NULL'.
  500.  
  501.           Security       Only the system administrator may use this
  502.                          statement.
  503.  
  504.           Concurrency    No locks are acquired.
  505.  
  506.           Comments       A remark in the SYSTEM.USERS table provides a
  507.                          convenient method of documenting the role of the
  508.                          user.
  509.  
  510.                          UserName is limited to 32 characters.
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.                                                 Statements: COMMENT ON USER
  533.           Quasar SQL Syntax                                   Page 10 of 52
  534.  
  535.  
  536.                                   Statement: COMMIT
  537.  
  538.  
  539.           Syntax         COMMIT [WORK];
  540.  
  541.                          Changes made to the database are not made
  542.                          permanent until this statement is executed.
  543.                          Should the current user execute a ROLLBACK or
  544.                          unexpectedly log off, all changes made by the user
  545.                          since logging in or executing a COMMIT (whichever
  546.                          occurred most recently) will vanish.
  547.  
  548.                          During database recovery only committed
  549.                          transactions are restored.
  550.  
  551.           Security       No authorization is required.
  552.  
  553.           Concurrency    As queries are executed within a transaction and
  554.                          records are created, read, updated or deleted; the
  555.                          database applies various kinds of locks on the
  556.                          applicable tables.  These locks are released when
  557.                          the transaction is committed or rolled back.  In
  558.                          order to minimize the conflict between
  559.                          transactions, be sure to minimize the amount of
  560.                          time these locks are in place by issuing a COMMIT
  561.                          or ROLLBACK whenever possible.
  562.  
  563.           Comments       Committing a transaction automatically starts a
  564.                          new transaction.  COMMIT is very fast since the
  565.                          changes have already been made, they are merely
  566.                          flagged as permanent.
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.                                                          Statements: COMMIT
  592.           Quasar SQL Syntax                                   Page 11 of 52
  593.  
  594.  
  595.                                Statement: CREATE INDEX
  596.  
  597.  
  598.           Syntax         CREATE [UNIQUE] INDEX
  599.                            [CreatorName.]IndexName
  600.                            ON [UserName.]TableName (
  601.                              ColumnName1 [ASC | DESC][,
  602.                              ColumnName2 [ASC | DESC]]
  603.                              ...
  604.                            );
  605.  
  606.                          This statement creates the index IndexName on the
  607.                          table TableName.  While indices are never
  608.                          referenced explicitly in SQL (other than creating
  609.                          and dropping them), they are used extensively by
  610.                          the Quasar Database Administrator to maximize
  611.                          system performance.
  612.  
  613.                          Phrase         Description
  614.  
  615.                          CREATE [UNIQUE] INDEX
  616.  
  617.                                         Specify UNIQUE if you wish key
  618.                                         values to be distinguishable, one
  619.                                         from another, across the entire
  620.                                         table upon which the index is
  621.                                         constructed.  If an attempt is made
  622.                                         to create a record in the table
  623.                                         which violates this unique
  624.                                         constraint, an error condition will
  625.                                         arise.
  626.  
  627.                          [CreatorName.]IndexName
  628.  
  629.                                         IndexName becomes the name of the
  630.                                         newly created index.  Specify
  631.                                         CreatorName if you wish the index
  632.                                         to belong to an user different from
  633.                                         the current user.
  634.  
  635.                          ON [UserName.]TableName
  636.  
  637.                                         TableName identifies the table upon
  638.                                         which the index is to be
  639.                                         constructed.  Specify UserName if
  640.                                         the table belongs to an user
  641.                                         different from the current user.
  642.  
  643.                          ColumnName1 [ASC | DESC]
  644.  
  645.                                         ColumnName identifies a column in
  646.                                         the table to be included in the
  647.                                         index key.  Specify ASC for
  648.                                         ascending and DESC for descending.
  649.  
  650.                                                    Statements: CREATE INDEX
  651.           Quasar SQL Syntax                                   Page 12 of 52
  652.  
  653.  
  654.                                         ASC is default.  We recommend
  655.                                         against the use of DESC, it is
  656.                                         included in order to conform to the
  657.                                         ANSI standard.
  658.  
  659.                          [, ColumnName2 [ASC | DESC]] ...
  660.  
  661.                                         Additional columns may be included
  662.                                         within the index key by creating a
  663.                                         list of columns separated by
  664.                                         commas.  The index key will be
  665.                                         constructed in the order in which
  666.                                         columns appear in this list.
  667.  
  668.           Security       The system administrator and the owner of the
  669.                          table are always authorized to create an index.
  670.                          Other users may create an index if and only if
  671.                          they have been granted INDEX authorization on the
  672.                          table by either the system administrator or by the
  673.                          owner of the table.  INDEX authorization is
  674.                          granted via the GRANT Privilege statement.
  675.  
  676.           Concurrency    An exclusive lock is acquired on the table upon
  677.                          which the index is constructed.  The lock is
  678.                          released when the transaction is committed.
  679.  
  680.           Comments       While indices may be created at anytime, we
  681.                          recommend that you create indices immediately
  682.                          after you create their base table; otherwise,
  683.                          CREATE INDEX has to read and rewrite all data
  684.                          which is already in the table.
  685.  
  686.                          The presence of suitable indices may greatly
  687.                          enhance system performance.  Indices do, however,
  688.                          cause a moderate increase in the amount of time it
  689.                          takes to write a record to the table upon which
  690.                          the index is constructed.  The database user
  691.                          should add indices judiciously.
  692.  
  693.                          ColumnName, CreatorName, IndexName, TableName and
  694.                          UserName are limited to 32 characters.
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.                                                    Statements: CREATE INDEX
  710.           Quasar SQL Syntax                                   Page 13 of 52
  711.  
  712.  
  713.                                Statement: CREATE TABLE
  714.  
  715.  
  716.           Syntax         CREATE TABLE [UserName.]TableName (
  717.                            ColumnName1 DataType1 [NOT NULL [UNIQUE]][,
  718.                            ColumnName2 DataType2 [NOT NULL [UNIQUE]]]
  719.                            ...
  720.                            [UNIQUE (ColumnNameA[, ColumnNameB] ... )][,
  721.                            UNIQUE (ColumnNameA[, ColumnNameB] ... )]
  722.                            ...
  723.                          );
  724.  
  725.                          This statement creates the table TableName with
  726.                          the columns as specified.
  727.  
  728.                          Phrase         Description
  729.  
  730.                          CREATE TABLE [UserName.]TableName
  731.  
  732.                                         TableName becomes the name of the
  733.                                         newly created table.  Specify
  734.                                         UserName if you wish the table to
  735.                                         belong to an user different from
  736.                                         the current user.
  737.  
  738.                          ColumnName1 DataType1 [NOT NULL [UNIQUE]]
  739.  
  740.                                         ColumnName identifies a column to
  741.                                         be included in the table.  DataType
  742.                                         indicates the data type of the
  743.                                         column.
  744.  
  745.                                         When a column is specified as NOT
  746.                                         NULL, any attempt to insert or
  747.                                         update a record which would result
  748.                                         in a NULL value in this column will
  749.                                         cause an error condition to arise.
  750.  
  751.                                         When a column is specified as
  752.                                         UNIQUE, an UNIQUE index is
  753.                                         automatically created for that
  754.                                         column.  This index will insure
  755.                                         that all values for that column are
  756.                                         distinguishable, one from another,
  757.                                         across the entire table.  Any
  758.                                         attempt to insert or update a
  759.                                         record which violates this unique
  760.                                         constraint will cause an error
  761.                                         condition to arise.
  762.  
  763.                          [, ColumnName2 DataType2 [NOT NULL UNIQUE]]] ...
  764.  
  765.                                         Additional columns may be included
  766.                                         within the table by creating a list
  767.  
  768.                                                    Statements: CREATE TABLE
  769.           Quasar SQL Syntax                                   Page 14 of 52
  770.  
  771.  
  772.                                         of column definitions separated by
  773.                                         commas.
  774.  
  775.                          [UNIQUE (ColumnNameA[, ColumnNameB] ... )]
  776.  
  777.                                         The combination of ColumnNameA,
  778.                                         ColumnNameB, ... are to be unique
  779.                                         across all records in the table.
  780.  
  781.                                         An UNIQUE index which includes the
  782.                                         named columns is automatically
  783.                                         created.  This index will insure
  784.                                         that key values for these columns
  785.                                         are distinguishable, one from
  786.                                         another, across the entire table.
  787.                                         Any attempt to insert or update a
  788.                                         record which violates this unique
  789.                                         constraint will cause an error
  790.                                         condition to arise.
  791.  
  792.                          [, UNIQUE (ColumnNameN[, ColumnNameO] ... )]
  793.  
  794.                                         Additional unique constraints may
  795.                                         be added by creating a list of
  796.                                         unique constraint definitions
  797.                                         separated by commas.  Each unique
  798.                                         constraint is maintained by a
  799.                                         separate UNIQUE index.
  800.  
  801.           Security       The system administrator and the prospective owner
  802.                          of the table are always authorized to create a
  803.                          table.  No user, other than the system
  804.                          administrator, may create a table which will
  805.                          belong to another user.
  806.  
  807.           Concurrency    As soon as the table is created, an exclusive lock
  808.                          is acquired on it.  The lock is released when the
  809.                          transaction is committed.
  810.  
  811.           Comments       ColumnName, TableName and UserName are limited to
  812.                          32 characters.
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.                                                    Statements: CREATE TABLE
  828.           Quasar SQL Syntax                                   Page 15 of 52
  829.  
  830.  
  831.                                   Statement: DELETE
  832.  
  833.  
  834.           Syntax         DELETE FROM [UserName.]TableName
  835.                            [WHERE SearchCondition];
  836.  
  837.                          This statement deletes records from the table
  838.                          TableName.  SearchCondition specifies which
  839.                          records are to be deleted.
  840.  
  841.                          Phrase         Description
  842.  
  843.                          DELETE FROM [UserName.]TableName
  844.  
  845.                                         TableName is the name of the table
  846.                                         containing the records to be
  847.                                         deleted.  Specify UserName if the
  848.                                         table belongs to an user different
  849.                                         from the current user.
  850.  
  851.                          WHERE SearchCondition
  852.  
  853.                                         SearchCondition specifies which
  854.                                         records are to be deleted.
  855.  
  856.           Security       The system administrator and the owner of the
  857.                          table are always authorized to delete records.
  858.                          Other users may delete records if and only if they
  859.                          have been granted DELETE authorization on the
  860.                          table by either the system administrator or by the
  861.                          owner of the table.  DELETE authorization is
  862.                          granted via the GRANT Privilege statement.
  863.  
  864.           Concurrency    An exclusive lock is acquired on the table from
  865.                          which records are to be deleted.  If the
  866.                          SearchCondition contains any subqueries, shared
  867.                          locks are acquired on all tables identified in the
  868.                          FROM clauses of those subqueries.  All locks are
  869.                          released when the transaction is committed.
  870.  
  871.           Comments       TableName and UserName are limited to 32
  872.                          characters.
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.                                                          Statements: DELETE
  887.           Quasar SQL Syntax                                   Page 16 of 52
  888.  
  889.  
  890.                                 Statement: DROP INDEX
  891.  
  892.  
  893.           Syntax         DROP INDEX [CreatorName.]IndexName
  894.                            ON [UserName.]TableName;
  895.  
  896.                          This statement deletes the index IndexName on the
  897.                          table TableName.
  898.  
  899.                          Phrase         Description
  900.  
  901.                          DROP INDEX [CreatorName.]IndexName
  902.  
  903.                                         IndexName is the name of the index
  904.                                         to be deleted.  Specify CreatorName
  905.                                         if the index belongs to an user
  906.                                         different from the current user.
  907.  
  908.                          ON [UserName.]TableName
  909.  
  910.                                         TableName identifies the table upon
  911.                                         which the index exists.  Specify
  912.                                         UserName if the table belongs to an
  913.                                         user different from the current
  914.                                         user.
  915.  
  916.           Security       The system administrator and the owner of the
  917.                          table are always authorized to drop an index.
  918.                          Other users may drop an index if and only if they
  919.                          created the index and have been granted INDEX
  920.                          authorization on the table by either the system
  921.                          administrator or by the owner of the table.  INDEX
  922.                          authorization is granted via the GRANT Privilege
  923.                          statement.
  924.  
  925.           Concurrency    An exclusive lock is acquired on the table from
  926.                          which the index is dropped.  The lock is released
  927.                          when the transaction is committed.
  928.  
  929.           Comments       While indices may be dropped at anytime, dropping
  930.                          an index on a table causes the entire table to be
  931.                          rebuilt.
  932.  
  933.                          When a table is deleted, all indices associated
  934.                          with that table are automatically dropped.
  935.  
  936.                          CreatorName, IndexName, TableName and UserName are
  937.                          limited to 32 characters
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.                                                      Statements: DROP INDEX
  946.           Quasar SQL Syntax                                   Page 17 of 52
  947.  
  948.  
  949.                                 Statement: DROP TABLE
  950.  
  951.  
  952.           Syntax         DROP TABLE [UserName.]TableName;
  953.  
  954.                          This statement deletes the table TableName.
  955.  
  956.                          Phrase         Description
  957.  
  958.                          DROP TABLE [UserName.]TableName
  959.  
  960.                                         TableName is the name of the table
  961.                                         to be deleted.  Specify UserName if
  962.                                         the table belongs to an user
  963.                                         different from the current user.
  964.  
  965.           Security       The system administrator and the owner of the
  966.                          table are always authorized to drop a table.  No
  967.                          user, other than the system administrator, may
  968.                          drop a table which belongs to another user.
  969.  
  970.           Concurrency    An exclusive lock is acquired on the table to be
  971.                          dropped.  The lock is released when the
  972.                          transaction is committed.
  973.  
  974.           Comments       All indices associated with the table are
  975.                          automatically dropped.  All grants of privileges
  976.                          on the table are automatically revoked.
  977.  
  978.                          TableName and UserName are limited to 32
  979.                          characters
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.                                                      Statements: DROP TABLE
  1005.           Quasar SQL Syntax                                   Page 18 of 52
  1006.  
  1007.  
  1008.                               Statement: GRANT CONNECT
  1009.  
  1010.  
  1011.           Syntax         GRANT CONNECT TO UserName1[, UserName2] ...
  1012.                            IDENTIFIED BY Password1[, Password2] ... ;
  1013.  
  1014.                          This statement grants users the privilege of
  1015.                          logging on to the Database Administrator,
  1016.                          executing queries and owning tables.
  1017.  
  1018.                          Phrase         Description
  1019.  
  1020.                          GRANT CONNECT TO UserName1
  1021.  
  1022.                                         Identifies the user name to be
  1023.                                         granted connect privileges.
  1024.  
  1025.                          [, UserName2] ...
  1026.  
  1027.                                         Additional users may be granted
  1028.                                         connect privileges by creating a
  1029.                                         list of user names separated by
  1030.                                         commas.
  1031.  
  1032.                          IDENTIFIED BY Password1
  1033.  
  1034.                                         Identifies the password to be
  1035.                                         associated with the user name.
  1036.  
  1037.                          [, Password2] ...
  1038.  
  1039.                                         If additional users were granted
  1040.                                         connect privileges, then each must
  1041.                                         be assigned a password by creating
  1042.                                         a list of passwords separated by
  1043.                                         commas.
  1044.  
  1045.           Security       Only the system administrator may use this
  1046.                          statement.
  1047.  
  1048.           Concurrency    No locks are acquired.
  1049.  
  1050.           Comments       If UserName identifies a pre-existing user, the
  1051.                          effect is that the user's password is changed to
  1052.                          the new setting.
  1053.  
  1054.                          Password and UserName are limited to 32
  1055.                          characters.
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.                                                   Statements: GRANT CONNECT
  1064.           Quasar SQL Syntax                                   Page 19 of 52
  1065.  
  1066.  
  1067.                              Statement: GRANT Privilege
  1068.  
  1069.  
  1070.           Syntax         GRANT
  1071.                            [ALL PRIVILEGES | Privilege1[, Privilege2] ... ]
  1072.                            ON TableName
  1073.                            TO [PUBLIC | UserName1[, UserName2] ... ] ;
  1074.  
  1075.                          This statement grants users certain access
  1076.                          privileges to a specified table.
  1077.  
  1078.                          Phrase         Description
  1079.  
  1080.                          [ALL PRIVILEGES | Privilege1[, Privilege2] ... ]
  1081.  
  1082.                                         Identifies the access to be
  1083.                                         granted.  Access is defined by
  1084.                                         creating a list of Privilege
  1085.                                         specifications separated by commas.
  1086.                                         The phrase ALL PRIVILEGES may be
  1087.                                         substituted for the list of all
  1088.                                         possible accesses.
  1089.  
  1090.                          ON TableName
  1091.  
  1092.                                         Identifies the table upon which the
  1093.                                         access is to be granted.
  1094.  
  1095.                          TO [PUBLIC | UserName1[, UserName2] ... ]
  1096.  
  1097.                                         Identifies the users who are to
  1098.                                         receive the access.  The phrase
  1099.                                         PUBLIC may be specified instead of
  1100.                                         a list of user names.  PUBLIC
  1101.                                         implies all users are granted the
  1102.                                         specified access.
  1103.  
  1104.           Security       The system administrator and the owner of the
  1105.                          table are always authorized to grant access to the
  1106.                          table.  No user, other than the system
  1107.                          administrator, may grant access to a table which
  1108.                          belongs to another user.
  1109.  
  1110.           Concurrency    No locks are acquired.
  1111.  
  1112.           Comments       Access granted by the system administrator is
  1113.                          tracked separately from access granted by the
  1114.                          owner of the table.  All redundant access grants
  1115.                          are combined; that is, granting the same access
  1116.                          several times to the same user creates only one
  1117.                          SYSTEM.TABLE_AUTHORIZATION record.
  1118.  
  1119.                          The effect of granting access may be reversed by
  1120.                          the REVOKE PRIVILEGE statement.
  1121.  
  1122.                                                 Statements: GRANT Privilege
  1123.           Quasar SQL Syntax                                   Page 20 of 52
  1124.  
  1125.  
  1126.                          TableName and UserName are limited to 32
  1127.                          characters.
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.                                                 Statements: GRANT Privilege
  1182.           Quasar SQL Syntax                                   Page 21 of 52
  1183.  
  1184.  
  1185.                                   Statement: INSERT
  1186.  
  1187.  
  1188.           Syntax         INSERT INTO [UserName.]TableName
  1189.                            [(ColumnName1[, ColumnName2] ... )]
  1190.                            VALUES (Value1[, Value2] ... );
  1191.  
  1192.           -- or --
  1193.  
  1194.           Syntax         INSERT INTO [UserName.]TableName
  1195.                            [(ColumnName1[, ColumnName2] ... )]
  1196.                            SelectStatement;
  1197.  
  1198.                          This statement inserts records into the table
  1199.                          TableName.
  1200.  
  1201.                          Phrase         Description
  1202.  
  1203.                          INSERT INTO [UserName.]TableName
  1204.  
  1205.                                         TableName is the name of the table
  1206.                                         into which records are to be
  1207.                                         inserted.  Specify UserName if the
  1208.                                         table belongs to an user different
  1209.                                         from the current user.
  1210.  
  1211.                          (ColumnName1[, ColumnName2] ... )
  1212.  
  1213.                                         Identifies columns into which data
  1214.                                         is to be deposited.  If any columns
  1215.                                         exist in the table which are not
  1216.                                         listed, they are set to the NULL
  1217.                                         value.  A column name may not be
  1218.                                         repeated.  Column names do not have
  1219.                                         to be in the same order as they are
  1220.                                         in the table itself.
  1221.  
  1222.                          VALUES (Value1[, Value2] ... )
  1223.  
  1224.                                         Specifies the values to be
  1225.                                         deposited in the record.  If a list
  1226.                                         of columns was supplied, there must
  1227.                                         be a match between the number of
  1228.                                         column names in the list and the
  1229.                                         number of values supplied.  If a
  1230.                                         list of columns was not supplied,
  1231.                                         there must be a match between the
  1232.                                         total number of columns in the
  1233.                                         table and the number of values
  1234.                                         supplied.
  1235.  
  1236.                                         The data type of the value must be
  1237.                                         compatible with the data type of
  1238.                                         the column into which it is to be
  1239.  
  1240.                                                          Statements: INSERT
  1241.           Quasar SQL Syntax                                   Page 22 of 52
  1242.  
  1243.  
  1244.                                         deposited.  When the column allows
  1245.                                         the NULL value, the value may be
  1246.                                         'NULL'.
  1247.  
  1248.                          SelectStatement
  1249.  
  1250.                                         The SelectStatement generates a set
  1251.                                         of records to be inserted.  If a
  1252.                                         list of columns was supplied, there
  1253.                                         must be a match between the number
  1254.                                         of column names in the list and the
  1255.                                         number of columns generated by the
  1256.                                         SelectStatement.  If a list of
  1257.                                         columns was not supplied, there
  1258.                                         must be a match between the total
  1259.                                         number of columns in the table and
  1260.                                         the number of columns generated by
  1261.                                         the SelectStatement.
  1262.  
  1263.                                         The data types of the columns
  1264.                                         generated by the SelectStatement
  1265.                                         must be compatible with the data
  1266.                                         types of the columns into which
  1267.                                         they are to be deposited.
  1268.  
  1269.           Security       The system administrator and the owner of the
  1270.                          table are always authorized to insert records.
  1271.                          Other users may insert records if and only if they
  1272.                          have been granted INSERT access on the table by
  1273.                          either the system administrator or by the owner of
  1274.                          the table.  INSERT access is granted via the GRANT
  1275.                          Privilege statement.
  1276.  
  1277.           Concurrency    An exclusive lock is acquired on the table into
  1278.                          which records are to be inserted.  If a
  1279.                          SelectStatement is employed, shared locks are
  1280.                          acquired on all tables identified in its FROM
  1281.                          clause.  If the SelectStatement contains any
  1282.                          subqueries, shared locks are acquired on all
  1283.                          tables identified in the FROM clauses of those
  1284.                          subqueries.  All locks are released when the
  1285.                          transaction is committed.
  1286.  
  1287.           Comments       ColumnName, TableName and UserName are limited to
  1288.                          32 characters.
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.                                                          Statements: INSERT
  1300.           Quasar SQL Syntax                                   Page 23 of 52
  1301.  
  1302.  
  1303.                               Statement: REVOKE CONNECT
  1304.  
  1305.  
  1306.           Syntax         REVOKE CONNECT FROM
  1307.                            [PUBLIC | UserName1[, UserName2] ... ];
  1308.  
  1309.                          This statement revokes from users' the privilege
  1310.                          of logging on to the Database Administrator,
  1311.                          executing queries and owning tables and indices.
  1312.                          The user is effectively removed from the database.
  1313.  
  1314.                          Phrase         Description
  1315.  
  1316.                          [PUBLIC | UserName1[, UserName2] ... ]
  1317.  
  1318.                                         Identifies the user name to be
  1319.                                         removed.  Additional users may be
  1320.                                         removed by creating a list of user
  1321.                                         names separated by commas.  The
  1322.                                         phrase PUBLIC may be specified
  1323.                                         instead of a list of user names.
  1324.                                         PUBLIC implies all users (other
  1325.                                         than the system administrator) are
  1326.                                         to be eliminated.
  1327.  
  1328.           Security       Only the system administrator may use this
  1329.                          statement.
  1330.  
  1331.           Concurrency    Exclusive locks are acquired on all tables
  1332.                          belonging to the user and all tables upon which
  1333.                          the user has created an index.  All locks are
  1334.                          released when the transaction is committed.
  1335.  
  1336.           Comments       When an user's connect privilege is revoked: all
  1337.                          that user's tables (and any associated indices)
  1338.                          are automatically dropped; all indices created by
  1339.                          that user are automatically dropped (even if
  1340.                          created on another user's table); all privileges
  1341.                          granted by that user to another user are
  1342.                          automatically revoked.
  1343.  
  1344.                          UserName is limited to 32 characters
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.                                                 Statements: REVOKE CONNECT:
  1359.           Quasar SQL Syntax                                   Page 24 of 52
  1360.  
  1361.  
  1362.                              Statement: REVOKE Privilege
  1363.  
  1364.  
  1365.           Syntax         REVOKE
  1366.                            [ALL PRIVILEGES | Privilege1[, Privilege2] ... ]
  1367.                            ON TableName
  1368.                            FROM [PUBLIC | UserName1[, UserName2] ... ];
  1369.  
  1370.                          This statement reduces users' access privilege to
  1371.                          a specified table.
  1372.  
  1373.                          Phrase         Description
  1374.  
  1375.                          [ALL PRIVILEGES | Privilege[, Privilege2] ... ]
  1376.  
  1377.                                         Identifies the access to be
  1378.                                         revoked.  Access is defined by
  1379.                                         creating a list of Privilege
  1380.                                         specifications separated by commas.
  1381.                                         The phrase ALL PRIVILEGES may be
  1382.                                         substituted for the list of all
  1383.                                         possible accesses.
  1384.  
  1385.                          ON TableName
  1386.  
  1387.                                         Identifies the table upon which the
  1388.                                         access is to be revoked.
  1389.  
  1390.                          [PUBLIC | UserName1[, UserName2] ... ]
  1391.  
  1392.                                         Identifies the users who are to
  1393.                                         lose the access.  The phrase PUBLIC
  1394.                                         may be substituted for the list of
  1395.                                         user names.  PUBLIC implies all
  1396.                                         users (other than the owner of the
  1397.                                         table and the system administrator)
  1398.                                         are to lose the specified access.
  1399.  
  1400.           Security       The system administrator and the owner of the
  1401.                          table are always authorized to reduce an user's
  1402.                          access to a table.  No user, other than the system
  1403.                          administrator, may revoke access to a table which
  1404.                          belongs to another user.
  1405.  
  1406.           Concurrency    If INDEX access is revoked, and the user has
  1407.                          created indices on the specified table: Exclusive
  1408.                          locks are acquired on the table.  The lock is
  1409.                          released when the transaction is committed.
  1410.  
  1411.           Comments       When an user's INDEX privilege is revoked: all
  1412.                          indices created on the specified table by the user
  1413.                          are automatically dropped.
  1414.  
  1415.  
  1416.  
  1417.                                                Statements: REVOKE Privilege
  1418.           Quasar SQL Syntax                                   Page 25 of 52
  1419.  
  1420.  
  1421.                          TableName and UserName are limited to 32
  1422.                          characters.
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.                                                Statements: REVOKE Privilege
  1477.           Quasar SQL Syntax                                   Page 26 of 52
  1478.  
  1479.  
  1480.                                  Statement: ROLLBACK
  1481.  
  1482.  
  1483.           Syntax         ROLLBACK [WORK];
  1484.  
  1485.                          Changes made to the database are not made
  1486.                          permanent until a COMMIT statement is executed.
  1487.                          ROLLBACK instructs the database to purge all
  1488.                          changes to the database by the current user since
  1489.                          logging in or executing a COMMIT (whichever
  1490.                          occurred most recently).
  1491.  
  1492.           Security       No authorization is required.
  1493.  
  1494.           Concurrency    As queries are executed within a transaction and
  1495.                          records are created, read, updated or deleted; the
  1496.                          database applies various kinds of locks on the
  1497.                          applicable tables.  These locks are released when
  1498.                          the transaction is committed or rolled back.  In
  1499.                          order to minimize the conflict between
  1500.                          transactions, be sure to minimize the amount of
  1501.                          time these locks are in place by issuing a COMMIT
  1502.                          or ROLLBACK whenever possible.
  1503.  
  1504.           Comments       Rolling a transaction back automatically starts a
  1505.                          new transaction.  ROLLBACK may take some time
  1506.                          while the Database Administrator purges updates.
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.                                                        Statements: ROLLBACK
  1536.           Quasar SQL Syntax                                   Page 27 of 52
  1537.  
  1538.  
  1539.                                   Statement: SELECT
  1540.  
  1541.  
  1542.           Syntax         SELECT [ALL | DISTINCT]
  1543.                            [* | Expression1[, Expression2] ... ]
  1544.                            FROM [UserName1.]TableName1 [CorrelationName1][,
  1545.                              [UserName2.]TableName2 [CorrelationName2]]
  1546.                              ...
  1547.                            [WHERE SearchCondition]
  1548.                            [GROUP BY ColumnSpecification1[,
  1549.                              ColumnSpecification2]
  1550.                              ...
  1551.                              [HAVING SearchCondition]]
  1552.                            [ORDER BY ColumnSpecificationA [ASC | DESC][,
  1553.                              ColumnSpecificationB [ASC | DESC]]
  1554.                              ... ];
  1555.  
  1556.                          This statement generates a result table.  There is
  1557.                          one column in the result table for each Expression
  1558.                          in the Expression list of the SELECT statement.
  1559.                          The values deposited in the columns of the result
  1560.                          table are generated by evaluating the
  1561.                          corresponding Expression.
  1562.  
  1563.                          Phrase         Description
  1564.  
  1565.                          SELECT [ALL | DISTINCT]
  1566.  
  1567.                                         ALL is default.  DISTINCT insures
  1568.                                         that all records in the result
  1569.                                         table are distinguishable, one from
  1570.                                         another.  When DISTINCT is
  1571.                                         specified, duplicate records are
  1572.                                         eliminated from the result table.
  1573.  
  1574.                          [* | Expression1[, Expression2] ... ]
  1575.  
  1576.                                         This list specifies the values to
  1577.                                         be inserted into the columns of the
  1578.                                         result table.  The data types of
  1579.                                         the columns of the result table are
  1580.                                         determined by the data types of the
  1581.                                         values resulting from the
  1582.                                         Expressions in this list.
  1583.  
  1584.                                         You may substitute a single '*' in
  1585.                                         place of the list of Expressions.
  1586.                                         '*' implies a list of all columns
  1587.                                         of all tables identified in the
  1588.                                         FROM clause.  You may not use '*'
  1589.                                         if you use the GROUP BY clause.
  1590.  
  1591.                          FROM [UserName1.]TableName1 [CorrelationName1]
  1592.  
  1593.  
  1594.                                                          Statements: SELECT
  1595.           Quasar SQL Syntax                                   Page 28 of 52
  1596.  
  1597.  
  1598.                                         TableName is the name of the table
  1599.                                         from which records are to be read.
  1600.                                         Specify UserName if the table
  1601.                                         belongs to an user different from
  1602.                                         the current user.
  1603.  
  1604.                                         CorrelationName is effectively an
  1605.                                         alias for the TableName which it
  1606.                                         follows.
  1607.  
  1608.                          [, [UserName2.]TableName2 [CorrelationName2]] ...
  1609.  
  1610.                                         Additional tables may be included
  1611.                                         by creating a list of tables
  1612.                                         separated by commas.  This
  1613.                                         effectively creates a Cartesian
  1614.                                         product of all the tables in the
  1615.                                         list.
  1616.  
  1617.                          WHERE SearchCondition
  1618.  
  1619.                                         SearchCondition specifies which
  1620.                                         records are to be read.
  1621.  
  1622.                          GROUP BY ColumnSpecification1
  1623.  
  1624.                                         Rearranges the tables identified by
  1625.                                         the FROM clause into groups such
  1626.                                         that within any one group all rows
  1627.                                         have the same value for the GROUP
  1628.                                         BY columns.  The SELECT clause is
  1629.                                         then applied to these groups.  Each
  1630.                                         group generates a single record in
  1631.                                         the result table.
  1632.  
  1633.                                         Please refer to a text book for a
  1634.                                         description of the "grouped table".
  1635.                                         "Grouped tables" are fully
  1636.                                         supported by the Quasar Database
  1637.                                         Administrator.
  1638.  
  1639.                          [, ColumnSpecification2] ...
  1640.  
  1641.                                         Additional columns may be included
  1642.                                         within the GROUP BY clause by
  1643.                                         creating a list of columns
  1644.                                         separated by commas.
  1645.  
  1646.                                         Please refer to a text book for a
  1647.                                         description of the "grouped table".
  1648.                                         "Grouped tables" are fully
  1649.                                         supported by the Quasar Database
  1650.                                         Administrator.
  1651.  
  1652.  
  1653.                                                          Statements: SELECT
  1654.           Quasar SQL Syntax                                   Page 29 of 52
  1655.  
  1656.  
  1657.                          HAVING SearchCondition
  1658.  
  1659.                                         Specifies a restriction on the
  1660.                                         grouped table resulting from the
  1661.                                         GROUP BY clause by eliminating
  1662.                                         groups not meeting the
  1663.                                         SearchCondition.
  1664.  
  1665.                                         Please refer to a text book for a
  1666.                                         description of the "grouped table".
  1667.                                         "Grouped tables" are fully
  1668.                                         supported by the Quasar Database
  1669.                                         Administrator.
  1670.  
  1671.                          ORDER BY ColumnSpecificationA [ASC | DESC]
  1672.  
  1673.                                         Records in the result table will be
  1674.                                         sorted on the basis of the data in
  1675.                                         the columns specified by the ORDER
  1676.                                         BY clause.  Specify ASC for
  1677.                                         ascending and DESC for descending.
  1678.                                         ASC is default.
  1679.  
  1680.                                         ColumnSpecification must identify
  1681.                                         one of the Expressions within the
  1682.                                         list of Expressions of the SELECT
  1683.                                         STATEMENT.  An integer may be used
  1684.                                         in place of the
  1685.                                         ColumnSpecification; when an
  1686.                                         integer is used it identifies which
  1687.                                         column in the result table is to be
  1688.                                         used to determine the order.
  1689.  
  1690.                          [, ColumnSpecificationB [ASC | DESC]] ...
  1691.  
  1692.                                         Additional ordering
  1693.                                         ColumnSpecifications (or integers)
  1694.                                         may be included within the ORDER BY
  1695.                                         clause by creating a list of
  1696.                                         columns (or integers) separated by
  1697.                                         commas.
  1698.  
  1699.           Security       The system administrator and the owner of the
  1700.                          table are always authorized to select records.
  1701.                          Other users may select records if and only if they
  1702.                          have been granted SELECT access on the table by
  1703.                          either the system administrator or by the owner of
  1704.                          the table.  SELECT access is granted via the GRANT
  1705.                          Privilege statement.
  1706.  
  1707.           Concurrency    A shared lock is acquired on the tables from which
  1708.                          records are to be selected.  If the
  1709.                          SearchCondition contains any subqueries, shared
  1710.                          locks are acquired on all tables identified in the
  1711.  
  1712.                                                          Statements: SELECT
  1713.           Quasar SQL Syntax                                   Page 30 of 52
  1714.  
  1715.  
  1716.                          FROM clauses of those subqueries.  These locks are
  1717.                          released when the transaction is committed.
  1718.  
  1719.           Comments       CorrelationName, TableName and UserName are
  1720.                          limited to 32 characters.
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.                                                          Statements: SELECT
  1772.           Quasar SQL Syntax                                   Page 31 of 52
  1773.  
  1774.  
  1775.                                   Statement: UPDATE
  1776.  
  1777.  
  1778.           Syntax         UPDATE [UserName.]TableName
  1779.                            SET ColumnName1 = Expression1[,
  1780.                              ColumnName2 = Expression2]
  1781.                              ...
  1782.                            [WHERE SearchCondition];
  1783.  
  1784.                          This statement modifies records in the table
  1785.                          TableName.  SearchCondition specifies which
  1786.                          records are to be modified.
  1787.  
  1788.                          Phrase         Description
  1789.  
  1790.                          UPDATE [UserName.]TableName
  1791.  
  1792.                                         TableName is the name of the table
  1793.                                         in which records are to be
  1794.                                         modified.  Specify UserName if the
  1795.                                         table belongs to an user different
  1796.                                         from the current user.
  1797.  
  1798.                          SET ColumnName1 = Expression1
  1799.  
  1800.                                         Expression is evaluated and the
  1801.                                         result placed in the column
  1802.                                         identified by ColumnName.  Columns
  1803.                                         not specifically identified are
  1804.                                         left unaffected.
  1805.  
  1806.                          [, ColumnName2 = Expression2] ...
  1807.  
  1808.                                         Additional columns may be modified
  1809.                                         by creating a list of ColumnNames
  1810.                                         and Expressions separated by
  1811.                                         commas.  A column name may not be
  1812.                                         repeated.
  1813.  
  1814.                          [WHERE SearchCondition]
  1815.  
  1816.                                         SearchCondition specifies which
  1817.                                         records are to be modified.
  1818.  
  1819.           Security       The system administrator and the owner of the
  1820.                          table are always authorized to update records.
  1821.                          Other users may update records if and only if they
  1822.                          have been granted UPDATE access on the table by
  1823.                          either the system administrator or by the owner of
  1824.                          the table.  UPDATE access is granted via the GRANT
  1825.                          Privilege statement.
  1826.  
  1827.           Concurrency    An exclusive lock is acquired on the table in
  1828.                          which records are to be updated.  If the
  1829.  
  1830.                                                          Statements: UPDATE
  1831.           Quasar SQL Syntax                                   Page 32 of 52
  1832.  
  1833.  
  1834.                          SearchCondition contains any subqueries, shared
  1835.                          locks are acquired on all tables identified in the
  1836.                          FROM clauses of those subqueries.  All locks are
  1837.                          released when the transaction is committed.
  1838.  
  1839.           Comments       ColumnName, TableName and UserName are limited to
  1840.                          32 characters.
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.                                                          Statements: UPDATE
  1890.           Quasar SQL Syntax                                   Page 33 of 52
  1891.  
  1892.  
  1893.                                      Data Types
  1894.  
  1895.  
  1896.           Data types are organized into three basic categories:
  1897.  
  1898.           Approximate Numeric This type is typically referred to as
  1899.                               floating point.
  1900.  
  1901.           Exact Numeric       This type is typically referred to as fixed
  1902.                               point.
  1903.  
  1904.           Character String    This type is used to store text.
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932.  
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.                                                                  Data Types
  1949.           Quasar SQL Syntax                                   Page 34 of 52
  1950.  
  1951.  
  1952.                            Data Types: Approximate Numeric
  1953.  
  1954.  
  1955.           This type is typically referred to as floating point.
  1956.  
  1957.           Data type      Description
  1958.  
  1959.           FLOAT          Floating point number with magnitude ranging from
  1960.                          approximately 1.7976931348623158e+308 to
  1961.                          2.2250738585072014e-308.
  1962.  
  1963.           FLOAT(p)       Floating point number with p significant digits,
  1964.                          with magnitude ranging from approximately
  1965.                          1.7976931348623158e+308 to 2.2250738585072014e-
  1966.                          308.
  1967.  
  1968.           REAL           Floating point number with magnitude ranging from
  1969.                          approximately 1.7976931348623158e+308 to
  1970.                          2.2250738585072014e-308.
  1971.  
  1972.           DOUBLE PRECISION Floating point number with magnitude ranging
  1973.                          from approximately 1.7976931348623158e+308 to
  1974.                          2.2250738585072014e-308.
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.                                             Data Types: Approximate Numeric
  2008.           Quasar SQL Syntax                                   Page 35 of 52
  2009.  
  2010.  
  2011.                               Data Types: Exact Numeric
  2012.  
  2013.  
  2014.           This type is typically referred to as fixed point.
  2015.  
  2016.           Data type      Description
  2017.  
  2018.           DEC            Signed decimal number with up to 19 digits of
  2019.                          which 0 appear to the right of the decimal point.
  2020.  
  2021.           DEC(p)         Signed decimal number with up to p digits of which
  2022.                          0 appear to the right of the decimal point; 1 <= p
  2023.                          <= 19.
  2024.  
  2025.           DEC(p, s)      Signed decimal number with up to p digits of which
  2026.                          s appear to the right of the decimal point; 1 <= p
  2027.                          <= 19 and 0 <= s <= p.
  2028.  
  2029.           DECIMAL        Signed decimal number with up to 19 digits of
  2030.                          which 0 appear to the right of the decimal point.
  2031.  
  2032.           DECIMAL(p)     Signed decimal number with up to p digits of which
  2033.                          0 appear to the right of the decimal point; 1 <= p
  2034.                          <= 19.
  2035.  
  2036.           DECIMAL(p, s)  Signed decimal number with up to p digits of which
  2037.                          s appear to the right of the decimal point; 1 <= p
  2038.                          <= 19 and 0 <= s <= p.
  2039.  
  2040.           INT            Whole number ranging from -2147483647 to
  2041.                          2147483647.
  2042.  
  2043.           INTEGER        Whole number ranging from -2147483647 to
  2044.                          2147483647.
  2045.  
  2046.           NUMERIC        Signed decimal number with up to 19 digits of
  2047.                          which 0 appear to the right of the decimal point.
  2048.  
  2049.           NUMERIC(p)     Signed decimal number with up to p digits of which
  2050.                          0 appear to the right of the decimal point; 1 <= p
  2051.                          <= 19.
  2052.  
  2053.           NUMERIC(p, s)  Signed decimal number with up to p digits of which
  2054.                          s appear to the right of the decimal point; 1 <= p
  2055.                          <= 19 and 0 <= s <= p.
  2056.  
  2057.           SMALLINT       Whole number ranging from -2147483647 to
  2058.                          2147483647.
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.                                                   Data Types: Exact Numeric
  2067.           Quasar SQL Syntax                                   Page 36 of 52
  2068.  
  2069.  
  2070.                             Data Types: Character String
  2071.  
  2072.  
  2073.           This type is used to store text.
  2074.  
  2075.           Data type      Description
  2076.  
  2077.           CHAR           Character data, length assumed to be 1.
  2078.  
  2079.           CHAR(n)        Character data, length specified by n where 1 <= n
  2080.                          <= 2047.
  2081.  
  2082.           CHARACTER      Character data, length assumed to be 1.
  2083.  
  2084.           CHARACTER(n)   Character data, length specified by n where 1 <= n
  2085.                          <= 2047.
  2086.  
  2087.           VARCHAR        Character data, variable length where maximum
  2088.                          length is 2047.
  2089.  
  2090.           VARCHAR(n)     Character data, variable length where maximum
  2091.                          length is specified by n where 1 <= n <= 2047.
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.  
  2120.  
  2121.  
  2122.  
  2123.  
  2124.  
  2125.                                                Data Types: Character String
  2126.           Quasar SQL Syntax                                   Page 37 of 52
  2127.  
  2128.  
  2129.                                       Operators
  2130.  
  2131.  
  2132.           The arithmetic operators have their usual meanings:
  2133.  
  2134.           +              The value on the right is added to the value on
  2135.                          the left.
  2136.  
  2137.           -              The value on the right is subtracted from the
  2138.                          value on the left.
  2139.  
  2140.           *              The value on the right is multiplied by the value
  2141.                          on the left.
  2142.  
  2143.           /              The value on the left is divided by the value on
  2144.                          the right.
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.                                                                   Operators
  2185.           Quasar SQL Syntax                                   Page 38 of 52
  2186.  
  2187.  
  2188.                                  Built-in functions
  2189.  
  2190.  
  2191.           Built-in functions act on several rows in a table together.
  2192.           Built-in functions may not be nested.  SQL supports the following
  2193.           built-in functions:
  2194.  
  2195.           AVG(Expression)          For each record selected, Expression is
  2196.                                    analyzed and a value obtained.  AVG
  2197.                                    returns the average of these values.
  2198.                                    Only values which are not NULL are
  2199.                                    included.
  2200.  
  2201.           COUNT(DISTINCT Expression) For each record selected, Expression
  2202.                                    is analyzed and a value obtained.
  2203.                                    COUNT(DISTINCT) returns the number of
  2204.                                    these values which are distinguishable,
  2205.                                    one from another.  Only values which are
  2206.                                    not NULL are included.
  2207.  
  2208.           COUNT(*)                 COUNT(*) returns the number of records
  2209.                                    selected.
  2210.  
  2211.           MAX(Expression)          For each record selected, Expression is
  2212.                                    analyzed and a value obtained.  MAX
  2213.                                    returns the maximum of these values.
  2214.                                    Only values which are not NULL are
  2215.                                    included.
  2216.  
  2217.           MIN(Expression)          For each record selected, Expression is
  2218.                                    analyzed and a value obtained.  MIN
  2219.                                    returns the minimum of these values.
  2220.                                    Only values which are not NULL are
  2221.                                    included.
  2222.  
  2223.           SUM(Expression)          For each record selected, Expression is
  2224.                                    analyzed and a value obtained.  SUM
  2225.                                    returns the sum of these values.  Only
  2226.                                    values which are not NULL are included.
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.                                                          Built-in functions
  2244.           Quasar SQL Syntax                                   Page 39 of 52
  2245.  
  2246.  
  2247.                                      Expressions
  2248.  
  2249.  
  2250.           Expressions can be:
  2251.  
  2252.                A column name
  2253.  
  2254.                A constant or literal value
  2255.  
  2256.                A built-in function
  2257.  
  2258.                An arithmetic combination of expressions
  2259.  
  2260.           Constants can be:
  2261.  
  2262.                Integer (for example: 100, -5, +127)
  2263.  
  2264.                Decimal (for example: 100.0, -.001, 1., +1.5)
  2265.  
  2266.                Floating point (for example: 1E10, -2E-7, +3.14159E0)
  2267.  
  2268.                Character string (for example: 'SMITH' '-@k9-22', '-1',
  2269.                'Quasar')
  2270.  
  2271.           Order of execution:
  2272.  
  2273.                Arithmetic expressions are evaluated before comparisons and
  2274.                logical operations.
  2275.  
  2276.                Arithmetic expressions are evaluated left to right except
  2277.                that multiplication and division are performed before
  2278.                addition and subtraction.  Parentheses can be used to
  2279.                control the order of evaluation.
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.                                                                 Expressions
  2303.           Quasar SQL Syntax                                   Page 40 of 52
  2304.  
  2305.  
  2306.                                       Privilege
  2307.  
  2308.  
  2309.           Privileges to access data in a table may be granted to users by
  2310.           either the system administrator or the owner of the table.
  2311.           Privileges are granted with the GRANT Privilege statement.
  2312.           Privileges are revoked with the REVOKE Privilege statement.
  2313.  
  2314.           Various types of access may be granted:
  2315.  
  2316.                ALL PRIVILEGES
  2317.  
  2318.                          This is the equivalent of the combined access of
  2319.                          DELETE, INDEX, INSERT, SELECT and UPDATE.
  2320.  
  2321.                DELETE
  2322.  
  2323.                          The user receiving DELETE access may delete
  2324.                          records from the table.
  2325.  
  2326.                INDEX
  2327.  
  2328.                          The user receiving INDEX access may create and
  2329.                          drop indices on the table.
  2330.  
  2331.                INSERT
  2332.  
  2333.                          The user receiving INSERT access may insert
  2334.                          records into the table.
  2335.  
  2336.                SELECT
  2337.  
  2338.                          The user receiving SELECT access may select
  2339.                          records from the table.
  2340.  
  2341.                UPDATE
  2342.  
  2343.                          The user receiving UPDATE access may update
  2344.                          records in the table.
  2345.  
  2346.                UPDATE ( ColumnName1[, ColumnName2] ... )
  2347.  
  2348.                          The user receiving UPDATE column access may update
  2349.                          only the named columns in the table.  This option
  2350.                          is not available when you revoke UPDATE
  2351.                          privileges.
  2352.  
  2353.           Several privileges may be granted at one time by creating a list
  2354.           of privileges separated by commas, ALL PRIVILEGES may not,
  2355.           however, be used within a list of privileges.
  2356.  
  2357.           Privileges may be revoked from users in a similar fashion.  When
  2358.           UPDATE privilege is revoked, individual columns may not be
  2359.  
  2360.  
  2361.                                                                   Privilege
  2362.           Quasar SQL Syntax                                   Page 41 of 52
  2363.  
  2364.  
  2365.           specified: UPDATE privilege may only be revoked for the entire
  2366.           table.
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.  
  2385.  
  2386.  
  2387.  
  2388.  
  2389.  
  2390.  
  2391.  
  2392.  
  2393.  
  2394.  
  2395.  
  2396.  
  2397.  
  2398.  
  2399.  
  2400.  
  2401.  
  2402.  
  2403.  
  2404.  
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.                                                                   Privilege
  2421.           Quasar SQL Syntax                                   Page 42 of 52
  2422.  
  2423.  
  2424.                                   Search Conditions
  2425.  
  2426.  
  2427.           A search condition can be a simple condition or a logical
  2428.           combination of conditions.  If the value of any expression is
  2429.           NULL then the condition evaluates to UNKNOWN:
  2430.  
  2431.           Simple conditions:
  2432.  
  2433.                Expression1 = Expression2
  2434.  
  2435.                          Evaluates to TRUE if and only if Expression1 has a
  2436.                          value equal to that of Expression2, otherwise the
  2437.                          condition evaluates to FALSE.
  2438.  
  2439.                Expression1 < Expression2
  2440.  
  2441.                          Evaluates to TRUE if and only if Expression1 has a
  2442.                          value less than that of Expression2, otherwise the
  2443.                          condition evaluates to FALSE.
  2444.  
  2445.                Expression1 <= Expression2
  2446.  
  2447.                          Evaluates to TRUE if and only if Expression1 has a
  2448.                          value less than or equal to that of Expression2,
  2449.                          otherwise the condition evaluates to FALSE.
  2450.  
  2451.                Expression1 > Expression2
  2452.  
  2453.                          Evaluates to TRUE if and only if Expression1 has a
  2454.                          value greater than that of Expression2, otherwise
  2455.                          the condition evaluates to FALSE.
  2456.  
  2457.                Expression1 >= Expression2
  2458.  
  2459.                          Evaluates to TRUE if and only if Expression1 has a
  2460.                          value greater than or equal to that of
  2461.                          Expression2, otherwise the condition evaluates to
  2462.                          FALSE.
  2463.  
  2464.                Expression1 <> Expression2
  2465.  
  2466.                          Evaluates to TRUE if and only if Expression1 has a
  2467.                          value which is not equal to that of Expression2,
  2468.                          otherwise the condition evaluates to FALSE.
  2469.  
  2470.                Expression1 [NOT] BETWEEN Expression2 AND Expression3
  2471.  
  2472.                          Same as [NOT] ((Expression2 <= Expression1) AND
  2473.                          (Expression1 <= Expression3).
  2474.  
  2475.                Expression1 [NOT] IN (Value1[, Value2] ...)
  2476.  
  2477.  
  2478.  
  2479.                                                           Search Conditions
  2480.           Quasar SQL Syntax                                   Page 43 of 52
  2481.  
  2482.  
  2483.                          Same as [NOT] ((Expression1 = Value1)[ OR
  2484.                          (Expression1 = Value2)] ... .
  2485.  
  2486.                Expression1 [NOT] IN (Subquery)
  2487.  
  2488.                          TRUE if Expression1 is [not] equal to any value
  2489.                          returned by Subquery.
  2490.  
  2491.                ColumnName [NOT] LIKE Pattern
  2492.  
  2493.                          Only available for character types: [not] TRUE if
  2494.                          the string in the specified column matches
  2495.                          Pattern.  In Pattern, '_' matches any single
  2496.                          character, '%' matches any character sequence.
  2497.  
  2498.                ColumnName IS [NOT] NULL
  2499.  
  2500.                          True if the value of ColumnName is [not] NULL.
  2501.  
  2502.                [NOT] EXISTS (Subquery)
  2503.  
  2504.                          [Not] TRUE if Subquery returns at least one
  2505.                          record.
  2506.  
  2507.                Expression1 [NOT] IN (Subquery)
  2508.  
  2509.                          [Not] TRUE if Subquery returns at least one value
  2510.                          which is equal to Expression1.
  2511.  
  2512.                Expression1 = [ANY | ALL | SOME] (Subquery)
  2513.                Expression1 < [ANY | ALL | SOME] (Subquery)
  2514.                Expression1 <= [ANY | ALL | SOME] (Subquery)
  2515.                Expression1 > [ANY | ALL | SOME] (Subquery)
  2516.                Expression1 >= [ANY | ALL | SOME] (Subquery)
  2517.                Expression1 <> [ANY | ALL | SOME] (Subquery)
  2518.  
  2519.                          Please refer to a text book for a description of
  2520.                          the "quantified" predicate.  While supported, we
  2521.                          recommend against its use.
  2522.  
  2523.           Logical combination of conditions:
  2524.  
  2525.                NOT Condition
  2526.  
  2527.                          Evaluates to TRUE if and only if Condition is
  2528.                          FALSE.  Evaluates to FALSE if and only if
  2529.                          Condition is TRUE.
  2530.  
  2531.                Condition1 AND Condition2
  2532.  
  2533.                          Evaluates to TRUE if and only if both Condition1
  2534.                          and Condition2 are TRUE.
  2535.  
  2536.                Condition1 OR Condition2
  2537.  
  2538.                                                           Search Conditions
  2539.           Quasar SQL Syntax                                   Page 44 of 52
  2540.  
  2541.  
  2542.                          Evaluates to TRUE if either Condition1 or
  2543.                          Condition2 is TRUE or both are TRUE.  Evaluates to
  2544.                          TRUE even if one Condition is UNKNOWN.
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.  
  2585.  
  2586.  
  2587.  
  2588.  
  2589.  
  2590.  
  2591.  
  2592.  
  2593.  
  2594.  
  2595.  
  2596.  
  2597.                                                           Search Conditions
  2598.           Quasar SQL Syntax                                   Page 45 of 52
  2599.  
  2600.  
  2601.                                    System Catalog
  2602.  
  2603.  
  2604.           The system catalog is composed of six tables: SYSTEM.COLUMNS,
  2605.           SYSTEM.COLUMN_AUTHORIZATION, SYSTEM.INDICES, SYSTEM.TABLES,
  2606.           SYSTEM.TABLE_AUTHORIZATION and SYSTEM.USERS.  All these tables
  2607.           belong to the system administrator.  These tables are
  2608.           automatically maintained by the Quasar Database Administrator.
  2609.  
  2610.           Unless otherwise indicated, you must not modify the system
  2611.           catalog tables.
  2612.  
  2613.           COLUMNS        This table contains information about all columns
  2614.                          of all tables in the database.
  2615.  
  2616.           COLUMN_AUTHORIZATION This table contains one record for each
  2617.                          grant of UPDATE access on a specific column of a
  2618.                          table.  Redundant grants are combined into a
  2619.                          single record.
  2620.  
  2621.           INDICES        This table contains information about all indices
  2622.                          in the database.  When more than one column is
  2623.                          included in an index, there is a separate record
  2624.                          for each column included.
  2625.  
  2626.           TABLES         This table contains information about all tables
  2627.                          in the database.
  2628.  
  2629.           TABLE_AUTHORIZATION This table contains one record for each grant
  2630.                          of access to a table.  Redundant grants are
  2631.                          combined into a single record.
  2632.  
  2633.           USERS          This table contains information about all users
  2634.                          known to the database.
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.  
  2648.  
  2649.  
  2650.  
  2651.  
  2652.  
  2653.  
  2654.  
  2655.  
  2656.                                                              System Catalog
  2657.           Quasar SQL Syntax                                   Page 46 of 52
  2658.  
  2659.  
  2660.                            System Catalog: SYSTEM.COLUMNS
  2661.  
  2662.  
  2663.           This table contains information about all columns of all tables
  2664.           in the database.  While you may modify the REMARK field of
  2665.           records in this table, the preferred method is to use the COMMENT
  2666.           ON COLUMN statement.  Modifying any other field will probably
  2667.           cause the system to irrecoverably crash.
  2668.  
  2669.           Column         Type/Description
  2670.  
  2671.           SEQUENCE_NUMBER SMALLINT Indicates the position of the column
  2672.                          within the table.
  2673.  
  2674.           LENGTH         SMALLINT Indicates the length of character strings
  2675.                          or the precision of numeric values.
  2676.  
  2677.           SCALE          SMALLINT Indicates the scale of numeric values.
  2678.  
  2679.           DATA_TYPE      VARCHAR(32) Indicates data type.
  2680.  
  2681.           NOT_NULL       CHARACTER(5) Indicates whether NULL values are
  2682.                          allowed.  TRUE indicates NULL is not allowed.
  2683.  
  2684.           USER_NAME      VARCHAR(32) Indicates the user name of the owner
  2685.                          of the table.
  2686.  
  2687.           TABLE_NAME     VARCHAR(32) Indicates the name of the table.
  2688.  
  2689.           COLUMN_NAME    VARCHAR(32) Indicates the name of the column.
  2690.  
  2691.           REMARK         VARCHAR(128) A comment.
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.  
  2715.                                              System Catalog: SYSTEM.COLUMNS
  2716.           Quasar SQL Syntax                                   Page 47 of 52
  2717.  
  2718.  
  2719.                      System Catalog: SYSTEM.COLUMN_AUTHORIZATION
  2720.  
  2721.  
  2722.           This table contains one record for each grant of UPDATE access on
  2723.           a specific column of a table.  While you may modify the REMARK
  2724.           field of records in this table,  modifying any other field will
  2725.           probably cause the system to irrecoverably crash.
  2726.  
  2727.           Column         Type/Description
  2728.  
  2729.           GRANTOR        VARCHAR(32) Indicates the user name of the user
  2730.                          granting access: the grantor will be either
  2731.                          "SYSTEM" (the system administrator) or the owner
  2732.                          of the table.
  2733.  
  2734.           GRANTEE        VARCHAR(32) Indicates the user name of the user
  2735.                          receiving the grant of access.
  2736.  
  2737.           USER_NAME      VARCHAR(32) Indicates the user name of the owner
  2738.                          of the table.
  2739.  
  2740.           TABLE_NAME     VARCHAR(32) Indicates the name of the table.
  2741.  
  2742.           COLUMN_NAME    VARCHAR(32) Indicates the name of the column.
  2743.  
  2744.           REMARK         VARCHAR(128) A comment.
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.                                        System Catalog: SYSTEM.AUTHORIZATION
  2775.           Quasar SQL Syntax                                   Page 48 of 52
  2776.  
  2777.  
  2778.                            System Catalog: SYSTEM.INDICES
  2779.  
  2780.  
  2781.           This table contains information about all indices in the
  2782.           database.  When more than one column is included in an index,
  2783.           there is a separate record for each column included.  While you
  2784.           may modify the REMARK field of records in this table,  modifying
  2785.           any other field will probably cause the system to irrecoverably
  2786.           crash.
  2787.  
  2788.           The INDEX_NAME of indices created by the Database Administrator
  2789.           to enforce unique constraints have a '~' as their first
  2790.           character.
  2791.  
  2792.           Column         Description
  2793.  
  2794.           USER_NAME      VARCHAR(32) Indicates the user name of the owner
  2795.                          of the table upon which the index is constructed.
  2796.  
  2797.           TABLE_NAME     VARCHAR(32) Indicates the name of the table upon
  2798.                          which the index is constructed.
  2799.  
  2800.           INDEX_NAME     VARCHAR(32) Indicates the name of the index.
  2801.  
  2802.           SEGMENT_NUMBER SMALLINT Indicates the position of the column
  2803.                          within the index key.
  2804.  
  2805.           NUMBER_OF_SEGMENTS SMALLINT Indicates the number of columns
  2806.                          included in the index key.
  2807.  
  2808.           DESCENDING     CHARACTER(5) Indicates whether the index is marked
  2809.                          as ascending or descending.  FALSE indicates
  2810.                          ascending while TRUE indicates descending.
  2811.  
  2812.           UNIQUE         CHARACTER(5) Indicates whether duplicate values
  2813.                          are allowed.  TRUE indicates all values must be
  2814.                          distinguishable, one from another.  FALSE
  2815.                          indicates duplicate values are allowed.
  2816.  
  2817.           CREATOR_NAME   VARCHAR(32) Indicates the user name of the creator
  2818.                          of the index.
  2819.  
  2820.           COLUMN_NAME    VARCHAR(32) Indicates the name of the column which
  2821.                          makes up this segment of the index key.
  2822.  
  2823.           REMARK         VARCHAR(128) A comment.
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.                                              System Catalog: SYSTEM.INDICES
  2834.           Quasar SQL Syntax                                   Page 49 of 52
  2835.  
  2836.  
  2837.                             System Catalog: SYSTEM.TABLES
  2838.  
  2839.  
  2840.           This table contains information about all tables in the database.
  2841.           While you may modify the REMARK field of records in this table,
  2842.           the preferred method is to use the COMMENT ON TABLE statement.
  2843.           Modifying any other field will probably cause the system to
  2844.           irrecoverably crash.
  2845.  
  2846.           The TABLE_NAME of temporary tables used by the Database
  2847.           Administrator during the execution of a query have a '~' as their
  2848.           first character.
  2849.  
  2850.           Column         Description
  2851.  
  2852.           TABLE_ID       SMALLINT Used internally to identify the MSDOS
  2853.                          files used in the table.
  2854.  
  2855.           NUMBER_OF_COLUMNS SMALLINT Indicates the number of columns in the
  2856.                          table.
  2857.  
  2858.           ISAM_CONTROL_BLOCK BINARY Used internally to save the ISAM
  2859.                          control block for the table.
  2860.  
  2861.           USER_NAME      VARCHAR(32) Indicates the name of the user who
  2862.                          owns the table.
  2863.  
  2864.           TABLE_NAME     VARCHAR(32) Indicates the name of the table.
  2865.  
  2866.           REMARK         VARCHAR(128) A comment.
  2867.  
  2868.  
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.                                               System Catalog: SYSTEM.TABLES
  2893.           Quasar SQL Syntax                                   Page 50 of 52
  2894.  
  2895.  
  2896.                      System Catalog: SYSTEM.TABLE_AUTHORIZATION
  2897.  
  2898.  
  2899.           This table contains one record for each grant of access.  While
  2900.           you may modify the REMARK field of records in this table,
  2901.           modifying any other field will probably cause the system to
  2902.           irrecoverably crash.
  2903.  
  2904.           Column         Type/Description
  2905.  
  2906.           GRANTOR        VARCHAR(32) Indicates the user name of the user
  2907.                          granting access: the grantor will be either SYSTEM
  2908.                          (the system administrator) or the owner of the
  2909.                          table.
  2910.  
  2911.           GRANTEE        VARCHAR(32) Indicates the user name of the user
  2912.                          receiving the grant of access.
  2913.  
  2914.           USER_NAME      VARCHAR(32) Indicates the user name of the owner
  2915.                          of the table.
  2916.  
  2917.           TABLE_NAME     VARCHAR(32) Indicates the name of the table.
  2918.  
  2919.           UPDATE_COLUMNS CHAR '*' indicates GRANTEE is allowed to update
  2920.                          specific columns (as specified in
  2921.                          SYSTEM.COLUMN_AUTHORIZATION) of the table, ' '
  2922.                          indicates no grant of this type of access.
  2923.  
  2924.           DELETE_AUTHORIZATION CHAR 'Y' indicates GRANTEE is allowed to
  2925.                          delete records from the table, ' ' indicates no
  2926.                          grant of this type of access.
  2927.  
  2928.           INDEX_AUTHORIZATION CHAR 'Y' indicates GRANTEE is allowed to
  2929.                          create and drop indices on the table, ' '
  2930.                          indicates no grant of this type of access.
  2931.  
  2932.           INSERT_AUTHORIZATION CHAR 'Y' indicates GRANTEE is allowed to
  2933.                          insert records into the table, ' ' indicates no
  2934.                          grant of this type of access.
  2935.  
  2936.           SELECT_AUTHORIZATION CHAR 'Y' indicates GRANTEE is allowed to
  2937.                          select records from the table, ' ' indicates no
  2938.                          grant of this type of access.
  2939.  
  2940.           UPDATE_AUTHORIZATION CHAR 'Y' indicates GRANTEE is allowed to
  2941.                          update records in the table, ' ' indicates no
  2942.                          grant of this type of access.
  2943.  
  2944.           REMARK         VARCHAR(128) A comment.
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.                                  System Catalog: SYSTEM.TABLE_AUTHORIZATION
  2952.           Quasar SQL Syntax                                   Page 51 of 52
  2953.  
  2954.  
  2955.                             System Catalog: SYSTEM.USERS
  2956.  
  2957.  
  2958.           This table contains information about all users known to the
  2959.           database.  While you may modify the REMARK field of records in
  2960.           this table, the preferred method is to use the COMMENT ON USER
  2961.           statement.  Modifying any other field will probably cause the
  2962.           system to irrecoverably crash.
  2963.  
  2964.           Column         Description
  2965.  
  2966.           USER_NAME      VARCHAR(32) Indicates an user name.
  2967.  
  2968.           USER_PASSWORD  VARCHAR(32) Indicates an user password.
  2969.  
  2970.           REMARK         VARCHAR(128) A comment.
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978.  
  2979.  
  2980.  
  2981.  
  2982.  
  2983.  
  2984.  
  2985.  
  2986.  
  2987.  
  2988.  
  2989.  
  2990.  
  2991.  
  2992.  
  2993.  
  2994.  
  2995.  
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.                                                System Catalog: SYSTEM.USERS
  3011.           Quasar SQL Syntax                                   Page 52 of 52
  3012.  
  3013.  
  3014.                                       Glossary
  3015.  
  3016.  
  3017.           current user             For any query, the current user is the
  3018.                                    user who logged onto the database and
  3019.                                    executed the query.
  3020.  
  3021.           exclusive lock           When an exclusive lock is obtained by
  3022.                                    one transaction on a table, other
  3023.                                    concurrent transactions attempting to
  3024.                                    acquire either an exclusive lock or a
  3025.                                    shared lock on the same table are
  3026.                                    aborted and rolled back.
  3027.  
  3028.           key                      A key is a set of columns within a table
  3029.                                    used to construct an index on that
  3030.                                    table.
  3031.  
  3032.           key value                The Database Administrator creates a key
  3033.                                    value by concatenating the values of all
  3034.                                    columns defined in an index.  The
  3035.                                    columns are concatenated in the order in
  3036.                                    which they were specified when the index
  3037.                                    was created.
  3038.  
  3039.           result table             All SELECT queries generate a table
  3040.                                    containing the chosen records.  This is
  3041.                                    called the result table.  Its contents
  3042.                                    are made available to you one at a time
  3043.                                    through one of the Quasar SQL API fetch
  3044.                                    Statements.
  3045.  
  3046.           shared lock              When a shared lock is obtained by one
  3047.                                    transaction on a table, other concurrent
  3048.                                    transactions attempting to acquire an
  3049.                                    exclusive lock on the same table are
  3050.                                    aborted and rolled back.  Other
  3051.                                    concurrent transactions attempting to
  3052.                                    acquire a shared lock on the same table
  3053.                                    are allowed to do so.
  3054.  
  3055.           system administrator     The user whose user name is SYSTEM.
  3056.                                    This user has absolute authority over
  3057.                                    all tables in the database.
  3058.  
  3059.           transaction journal      A transaction journal is a pair of files
  3060.                                    ('or_log.dat' and 'or_log.idx') written
  3061.                                    by the Database Administrator.  The
  3062.                                    transaction journal contains a record of
  3063.                                    every event which caused a change to the
  3064.                                    database.
  3065.  
  3066.  
  3067.  
  3068.  
  3069.                                                                    Glossary